<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>327-3</title>
    <!--电子时钟 2018.03.27  13:25:56-->
    <style>
        #rq{
            font-size: 30px;
            font-weight: bold;
            text-align: center;
        }
    </style>
</head>
<body>
<div>
    <input type="text" id="rq">
</div>
<script>

    Date.prototype.toString=function(){
        return this.getFullYear()+"-"+(this.getMonth()+1)+"-"+this.getDate()+" "+this.getHours()+":"+this.getMinutes()
        +":"+this.getSeconds();
    }
    setInterval(function(){
        var date=new Date();
        rq.value=date;
    },1000);
</script>
</body>
</html>